//package com.hnucm.cooklife.adapter;
//
//import android.content.Context;
//import android.text.Html;
//import android.text.TextUtils;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewGroup;
//import android.widget.AdapterView;
//import android.widget.Button;
//import android.widget.ImageView;
//import android.widget.TextView;
//
//import androidx.annotation.NonNull;
//import androidx.recyclerview.widget.RecyclerView;
//
//import com.blankj.utilcode.util.ToastUtils;
//import com.bumptech.glide.Glide;
//import com.hnucm.cooklife.R;
//import com.hnucm.cooklife.bean.db.Foll;
//import com.hnucm.cooklife.ui.activity.MomentListActivity;
//import com.qmuiteam.qmui.widget.dialog.QMUIBottomSheet;
//
//import java.util.ArrayList;
//import java.util.List;
//
//import butterknife.BindView;
//import butterknife.ButterKnife;
//import cn.bingoogolapple.baseadapter.BGARecyclerViewAdapter;
//import cn.bingoogolapple.baseadapter.BGAViewHolderHelper;
//import cn.bingoogolapple.photopicker.widget.BGANinePhotoLayout;
//import de.hdodenhof.circleimageview.CircleImageView;
//
//public class FollAdapter extends BGARecyclerViewAdapter<Foll> {
//    private Context mContext;
//    private List<Foll> mFollList = new ArrayList<>();
//
//    //此变量类型为自定义接口类型
//    private onItemClickListener mOnItemClickListener;
//
//    //自定义接口实现点击事件，低耦合
//    public interface onItemClickListener{
//        void onSeleClickListener(View view,int position);
//    }
//
//    public void setOnItemClickListener(onItemClickListener clickListener){
//        this.mOnItemClickListener = clickListener;
//    }
//
//    public void setFollList(List<Foll> follList){
//        mFollList.clear();
//        mFollList.addAll(follList);
//        notifyDataSetChanged();
//    }
//
//    public FollAdapter(Context context, List<Foll> follList) {
//        super(null);
//        mContext = context;
//        mFollList.addAll(follList);
//    }
//
//    @NonNull
//    @Override
//    public FollHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
//        View view = LayoutInflater.from(mContext).inflate(R.layout.foll_item, parent, false);
//        return new FollHolder(view,mOnItemClickListener);
//    }
//
//    @Override
//    public void onBindViewHolder(@NonNull FollHolder holder, int position) {
//        if(mFollList != null){
//            Foll foll = mFollList.get(position);
//            holder.mName.setText(
//                    Html.fromHtml(String.valueOf(foll.userName),Html.FROM_HTML_MODE_COMPACT)
//            );
//            holder.mTime.setText(
//                    Html.fromHtml(String.valueOf(foll.niceDate),Html.FROM_HTML_MODE_COMPACT)
//            );
//            holder.mContent.setText(
//                    Html.fromHtml(String.valueOf(foll.userContent),Html.FROM_HTML_MODE_COMPACT)
//            );
//            Glide.with(mContext).load(foll.userHeader).into(holder.mHeader);
//        }
//    }
//
//
//    class FollHolder extends RecyclerView.ViewHolder{
//        @BindView(R.id.foll_header)
//        CircleImageView mHeader;
//
//        @BindView(R.id.foll_name)
//        TextView mName;
//
//        @BindView(R.id.foll_post_time)
//        TextView mTime;
//
//        @BindView(R.id.foll_content)
//        TextView mContent;
//
//        @BindView(R.id.foll_pic)
//        ImageView mPic;
//
//        @BindView(R.id.foll_menu)
//        ImageView mSeleMenu;
//
//        public FollHolder(@NonNull View itemView, final onItemClickListener onClickListener) {
//            super(itemView);
//            ButterKnife.bind(this,itemView);
//            mSeleMenu.setOnClickListener(new View.OnClickListener() {
//                @Override
//                public void onClick(View v) {
//                    int position = getAdapterPosition();
//                    if(position != RecyclerView.NO_POSITION){
//                        onClickListener.onSeleClickListener(itemView,position);
//                    }
//                }
//            });
//        }
//    }
//
//    public FollAdapter(RecyclerView recyclerView) {
//        super(recyclerView,R.layout.item_moment);
//    }
//
//    @Override
//    protected void fillData(BGAViewHolderHelper helper, int position, Foll foll) {
//        if (TextUtils.isEmpty(foll.userContent)) {
//            helper.setVisibility(R.id.foll_content, View.GONE);
//        } else {
//            helper.setVisibility(R.id.foll_content, View.VISIBLE);
//            helper.setText(R.id.foll_content, foll.userContent);
//        }
//
//
//
//        BGANinePhotoLayout ninePhotoLayout = helper.getView(R.id.foll_pic);
////        ninePhotoLayout.setDelegate(MomentListActivity.this);
////        ninePhotoLayout.setData(moment.photos);
//    }
//}
